package com.ssm.entity;

/**
 * 用户实体类
 */
public class User {
	private int uid;
	private String uname;
	private String alias;
	private String passwd;
	private String logo;
	private String last_login_time;
	private int status;
	private Role role;
	
	public int getUid() {
		return uid;
	}
	public void setUid(int uid) {
		this.uid = uid;
	}
	public String getUname() {
		return uname;
	}
	public void setUname(String uname) {
		this.uname = uname;
	}
	public String getAlias() {
		return alias;
	}
	public void setAlias(String alias) {
		this.alias = alias;
	}
	public String getPasswd() {
		return passwd;
	}
	public void setPasswd(String passwd) {
		this.passwd = passwd;
	}
	public String getLogo() {
		return logo;
	}
	public void setLogo(String logo) {
		this.logo = logo;
	}
	public String getLast_login_time() {
		return last_login_time;
	}
	public void setLast_login_time(String last_login_time) {
		this.last_login_time = last_login_time;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public Role getRole() {
		return role;
	}
	public void setRole(Role role) {
		this.role = role;
	}
	
	/**
	 * 获取角色ID的便捷方法
	 * @return 角色ID
	 */
	public Integer getRid() {
		return role != null ? role.getRid() : null;
	}
	
	/**
	 * 设置角色ID的便捷方法
	 * @param rid 角色ID
	 */
	public void setRid(int rid) {
		if (role == null) {
			role = new Role();
		}
		role.setRid(rid);
	}	
}
